<?php

function sortBubble ($array) {
	$arraySize = count($array);

	foreach ($array as $x => $xvalue){
		foreach ($array as $y => $yvalue){
			if ($array[$x]["distance"] < $array[$y]["distance"]) {
				$hold = $array[$x];
				$array[$x] = $array[$y];
				$array[$y] = $hold;
			}
		}
	}

	return $array;
}

?>